package com.calvin.study.ocr.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import com.calvin.study.ocr.AbstractService;
import com.calvin.study.ocr.IParseService;
import com.calvin.study.ocr.service.IBizService;

import cn.hutool.core.util.RandomUtil;

@Service
public class BizService extends AbstractService implements IBizService {
	
	@Autowired
	@Qualifier(value="s1")
	private IParseService parseService1;
	@Autowired
	@Qualifier(value="s2")
	private IParseService parseService2;
	@Autowired
	@Qualifier(value="s3")
	private IParseService parseService3;

	@Override
	public void parseData() throws Exception {
		parseCf();
		
		int type = RandomUtil.randomInt(01, 04);
		switch (type) {
		case 1:
			parseService1.parseMx("temp"+type);
			break;
		case 2:
			parseService2.parseMx("temp"+type);
			break;
		case 3:
			parseService3.parseMx("temp"+type);
			break;
		default:
			break;
		}
	}

}
